package com.lrs.java.j2se_self.ioReview;
import java.io.*;
public class TestPrintStream2 {
	public static void main(String[] args){
		String filename = args[0];
		try{
			PrintStream psr = new PrintStream("C:\\test11.java");
			System.setOut(psr);
		}catch(IOException e){
			e.printStackTrace();
		}
		if(filename != null){
			printF(filename,System.out);
		}	
	}
	public static void printF(String file , PrintStream ps){
		try{
			FileReader fs = new FileReader(file);
			BufferedReader bis = new BufferedReader(fs);
			String s = null;
			while((s = bis.readLine()) != null){
				ps.println(s);
			}
			bis.close();
		}catch(IOException e){
			e.getMessage();
		}
	}
}
